﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using _430GroupProject;
using System.Web.Security;

namespace WebClient
{
    public partial class TeamManagement : System.Web.UI.Page
    {
        private ArrayList _data;

        protected void Page_Load(object sender, EventArgs e)
        {
            ArrayList teamData = new ArrayList(); //Get Teams this user supervises.
            teamData.Add("Team1");
            teamData.Add("Team2");
            teamData.Add("Team3");

            TeamSelect.DataSource = teamData;
            TeamSelect.DataBind();

            GatherData(1);
            BindData();
        }


        protected void LoadNewData(object sender, EventArgs e)
        {
            GatherData(2);
            BindData();
        }

        

        private void RemoveUser(object sender, DataGridItemEventArgs e)
        {
            //Use WCF to remove a User from a given team.  Delete User entirely if it is only a part of this team.
        }

        private void GatherData(int testVal)
        {
            //String lookupName = Membership.GetUser().UserName;

            //Build list based on current User and Current Team.

            this._data = new ArrayList();
            User test = new User("UserID0"+testVal,"usrNetID", "123456789", "John Doe");
            this._data.Add(test);

        }

        private void BindData()
        {
            SupervisedUsers.DataSource = this._data;
            SupervisedUsers.DataBind();
        }
    }
}